using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class TL_JunctionTypeMap : EntityTypeConfiguration<TL_JunctionType>
    {
        public TL_JunctionTypeMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Code)
                .HasMaxLength(20);

            this.Property(t => t.Table_A)
                .HasMaxLength(20);

            this.Property(t => t.Table_B)
                .HasMaxLength(20);

            this.Property(t => t.ID_A)
                .HasMaxLength(20);

            this.Property(t => t.ID_B)
                .HasMaxLength(20);

            this.Property(t => t.Name_A)
                .HasMaxLength(20);

            this.Property(t => t.Name_B)
                .HasMaxLength(20);

            this.Property(t => t.SearchTemplate)
                .HasMaxLength(20);

            this.Property(t => t.EditObject)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("TL_JunctionType");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.Table_A).HasColumnName("Table_A");
            this.Property(t => t.Table_B).HasColumnName("Table_B");
            this.Property(t => t.ID_A).HasColumnName("ID_A");
            this.Property(t => t.ID_B).HasColumnName("ID_B");
            this.Property(t => t.Name_A).HasColumnName("Name_A");
            this.Property(t => t.Name_B).HasColumnName("Name_B");
            this.Property(t => t.SearchTemplate).HasColumnName("SearchTemplate");
            this.Property(t => t.EditObject).HasColumnName("EditObject");
        }
    }
}
